/**
 * @param {number} n
 * @return {number}
 */
var climbStairs = function (n) {
  if (n == 1) return 1
  const a = [1, 2]
  for (let i = 2; i < n; i++) {
    let temp = a[0] + a[1]
    a[0] = a[1]
    a[1] = temp
  }
  return a[1]
};